From 33eba2a469cc04baeb40b3008e65ddc9a2bead8b Mon Sep 17 00:00:00 2001 From: Robert Lipe Date: Fri, 6 Jul 2018 23:20:18 -0500 Subject: [PATCH] More queue casting MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This doesn’t _really_ help improve the code; this is to get a passing presubmit from codify. --- igc.cc | 6 +++--- mapsource.cc | 3 ++- psitrex.cc | 2 -- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/igc.cc b/igc.cc index 5b6734889..2116ac4f3 100644 --- a/igc.cc +++ b/igc.cc @@ -892,9 +892,9 @@ static void wr_track() } // Iterate through waypoints in both tracks simultaneously QUEUE_FOR_EACH(&gnss_track->waypoint_list, elem, tmp) { - Waypoint* wpt = (Waypoint*) elem; - double pres_alt = interpolate_alt(pres_track, wpt->GetCreationTime().toTime_t() + time_adj); - wr_fix_record(wpt, (int) pres_alt, (int) wpt->altitude); + // FIXME(NEW_Q): the excessive casting of the iterators is gross. Rethink. + double pres_alt = interpolate_alt(pres_track, ((Waypoint*) elem)->GetCreationTime().toTime_t() + time_adj); + wr_fix_record(((Waypoint*) elem), (int) pres_alt, (int) ((Waypoint*)elem)->altitude); } } else { if (pres_track) { diff --git a/mapsource.cc b/mapsource.cc index 118cd05f5..b49a39303 100644 --- a/mapsource.cc +++ b/mapsource.cc @@ -139,7 +139,8 @@ mps_find_wpt_q_by_name(const queue* whichQueue, const QString& name) queue* elem, *tmp; QUEUE_FOR_EACH(whichQueue, elem, tmp) { - Waypoint* waypointp = (Waypoint*) elem; + void* vwaypointp = static_cast(elem); + Waypoint* waypointp = static_cast(vwaypointp); if (waypointp->shortname == name) { return waypointp; } diff --git a/psitrex.cc b/psitrex.cc index 0a1d4319f..be0e15088 100644 --- a/psitrex.cc +++ b/psitrex.cc @@ -456,8 +456,6 @@ psit_routehdr_w(gbfile* psit_file, const route_head* rte) { QString rname; - Waypoint* testwpt; - /* total nodes (waypoints) this route */ if (rte->waypoint_list.next) { // this test doesn't do what I w ant i.e test if this is a valid -- 2.30.2